package com.dz.time;

import org.apache.flink.streaming.api.scala.function.WindowFunction;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.util.Collector;
import scala.collection.Iterable;

/**
 * @ClassName MyCountWindowFunction2
 * @Description TODO
 * @Author zhangdong
 * @Date 2020/11/29 21:43
 * @Version 1.0
 */
public class MyCountWindowFunction2 implements WindowFunction<Long,String,String, TimeWindow> {
    @Override
    public void apply( String s,  TimeWindow window,  Iterable<Long> input,  Collector<String> out) {
        out.collect("----------------窗口时间："+window.getEnd());
        out.collect("商品ID: "+s+"  浏览量: "+input.iterator().next());

    }
}
